public class FactoryTest {
    public static void main(String[] args) {
        // 测试创建ConcreteProductA
        Product productA = Factory.createProduct("A");
        System.out.println("创建产品A：");
        productA.operation();
        
        // 测试创建ConcreteProductB
        Product productB = Factory.createProduct("B");
        System.out.println("\n创建产品B：");
        productB.operation();
        
        // 测试无效类型
        Product invalidProduct = Factory.createProduct("C");
        System.out.println("\n创建无效产品：" + (invalidProduct == null ? "返回null" : "失败"));
    }
}